package com.xnck.demo.flowabledemo.behavior;

import org.flowable.bpmn.model.UserTask;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.impl.bpmn.behavior.UserTaskActivityBehavior;

/**
 * 自定义UserTask节点的Behavior
 */
public class ExtUserTaskActivityBehavior extends UserTaskActivityBehavior {

    private static final long serialVersionUID = 7711531472879418236L;

    ExtUserTaskActivityBehavior(UserTask userTask) {
        super(userTask);
    }

    @Override
    public void execute(DelegateExecution execution) {
        System.out.println("这是自定义Behavior的输出：进入节点" + execution.getCurrentActivityId());
        super.execute(execution);
    }

    @Override
    public void trigger(DelegateExecution execution, String signalName, Object signalData) {
        System.out.println("这是自定义Behavior的输出：触发离开节点" + execution.getCurrentActivityId());
        super.trigger(execution, signalName, signalData);
    }
}
